package com.flyox.game.fivetiger.server;

public class ServerException extends Exception {
	private static final long serialVersionUID = 2808751337647308149L;

	public static final int SUCCESS = 0;
	public static final int INVALID_PARAMETER = 1;
	public static final int IOEXCEPTION = 2;
	public static final int CLASSNOTFOUNDEXCEPTION = 3;
	public static final int UNKNOWNHOSTEXCEPTION = 4;

	private int errorCode = 0;

	public ServerException(String msg) {
		super(msg);
	}

	public ServerException(String msg, int errorCode) {
		super("[" + errorCode + "]" + msg);
		this.errorCode = errorCode;
	}

	public ServerException(Throwable t, int errorCode) {
		super("[" + errorCode + "]", t);
		this.errorCode = errorCode;
	}

	public ServerException(String msg, Throwable t, int errorCode) {
		super("[" + errorCode + "]" + msg, t);
		this.errorCode = errorCode;
	}

	public int getErrorCode() {
		return errorCode;
	}

}
